package Dao;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MyInvocationHandler implements InvocationHandler {
    private Cal cal;

    private Object obj;

    public void bind(Object obj){
        this.obj=obj;
    }
    @Override
    public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
        System.out.println(method.getName() + "方法的参数是" + args);

        Object result = method.invoke(obj,args);

        System.out.println(method.getName( ) + "方法的计算结果是" + result);

        return null;
    }
}
